/*global jQuery, $ */

var Common = {};

$(document).ready(function readyDocument() {
    var state = 1;
    
    var sectionCalculator = $("#section-calculator").hide();
    var sectionFront = $("#section-front");
        
    var buttonLogin = $("#button-login").button({icons:{primary:'ui-icon-circle-check'}});
    var buttonBack = $("#button-back").button({icons:{primary:'ui-icon-circle-arrow-w'}}).click( function() { showFront();} );
    
    var buttonBig1 = $("#button-big1").click(function(){ state=1; showCalculator(); }); 
    var buttonBig2 = $("#button-big2").click(function(){ state=2; showCalculator(); });;
    var buttonBig3 = $("#button-big3").click(function(){ state=3; showCalculator(); });;
    
    var buttonSmall1 = $("#button-small1");
    var buttonSmall2 = $("#button-small2");
    var buttonSmall3 = $("#button-small3");
    var buttonSmall4 = $("#button-small4");

    $( "#accordion" ).accordion({
            collapsible: true,
			heightStyle: "content"
    });
    
    showCalculator = function() {
        sectionFront.hide("slide", {direction: "left"}, 500);//fadeOut('fast',function() {sectionFront.hide()});
        sectionCalculator.show("slide", {direction: "left"}, 500);
    };
    
    showFront = function() {
        sectionCalculator.hide("slide", {direction: "left"}, 500);
        sectionFront.show("slide", {direction: "left"}, 500);//fadeOut('fast',function() {sectionFront.hide()});
    };
    
});

